#include "Name.h"
#include "IVisitor.h"

Name::Name(const QString& id, int ctx, bool reserved, int nodeId):
    exprType(nodeId),
    _id(id),
    _ctx(ctx),
    _reserved(reserved)
{
}
    
Name::~Name()
{
    
}
    
Ast::AstTypes Name::type() const
{
    return Ast::Name;
}
    

QString Name::id()
{
    return _id;
}

void Name::setId(const QString& id)
{
    _id = id;
}

int Name::ctx()
{
    return _ctx;
}

void Name::setCtx(int ctx)
{
    _ctx = ctx;
}

bool Name::reserved()
{
    return _reserved;
}

void Name::setReserved(bool reserved)
{
    _reserved = reserved;
}

    
QString Name::toString() const
{
    return QString("Name[id=%1, ctx=%2, reserved=%3]").
                arg(_id).
                arg(_ctx).
                arg(_reserved);
}
    
void Name::accept(IVisitor* visitor, const SimpleNodePtr& node)
{
    visitor->visitName(node.dynamicCast<Name>());
}
    
void Name::traverse(IVisitor* visitor)
{
}